package com.appbee.article.client.presenter;

import com.appbee.core.client.json.Json;
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;

public class ArticleSettings
{
	private String articleId;

	public ArticleSettings()
	{
	}

	public ArticleSettings(String settingsString)
	{
		GWT.log("Parse settings: " + settingsString);
		Json json = Json.parseStrict(settingsString);
		articleId = json.getString("id", "");
	}

	public String getArticleId()
	{
		return articleId;
	}


	public void setArticleId(String articleId)
	{
		this.articleId = articleId;
	}

	public String toSettingsString()
	{
		JSONObject json = new JSONObject();
		json.put("id", new JSONString(articleId));
		return json.toString();
	}
}
